-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(steps): add install-node step #49
Conversation
cb92775
to
5c911da
Compare
16886ee
to
5a011be
Compare
workflow-steps/install-node/main.js
Outdated
// TODO: switch step to remove nvm instaall when nvm is in the base image | ||
if (process.env.NX_CLOUD_NODE_VERSION || existsSync('.nvmrc')) { | ||
try { | ||
// have to run as single command to keep the nvm env vars in the same shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: there was some issues when I tried running these commands as discrete commands where I'd get permission denied and other errors when trying to load in the nvm.sh file, so I just switch to mimic the equivalent in bash scripts to get things working.
I also tried adding nvm into the base image, but ran into the same issues with permission errors and unable to find things correctly in PATH. unsure what the exact issue is there.
Also I'd like some help in testing this, as trying to reference this step results in steps erroring out sliently in some way that I'm unsure how to debug. |
Might need to go back to the drawing board on this one, as using corepack results in potential issues of peoples package.json getting modified if they aren't using corepack which can result in affected/cache hits.
|
@barbados-clemens You can try setting Source: https://github.com/nodejs/corepack?tab=readme-ov-file#environment-variables |
5a011be
to
924b3d9
Compare
This step allows installing a defined version of node via nvm. This version can be passed to agents via the `NX_CLOUD_NODE_VERSION` environment variable or via populating a `.nvmrc` file in the workspace. ```yaml - name: Install Node v18 uses: 'nrwl/nx-cloud-workflows/<version>/workflow-steps/install-nodes/main.yaml' env: NX_CLOUD_NODE_VERSION: 18 ``` if a `.nvmrc` file exists in the workspace (via a checkout step), then the `NX_CLOUD_NODE_VERSION` can be omitted. ```yaml - name: Install Node v18 uses: 'nrwl/nx-cloud-workflows/<version>/workflow-steps/install-nodes/main.yaml' ```
877ba77
to
b5511e5
Compare
fixed issued with info from james in a new test image. |
b5511e5
to
07735a2
Compare
we'll follow up with support windows when we figure out what toolchain makes the most sense to use for custom node versions in windows
This step allows installing a defined version of node via nvm.
This version can be passed to agents via the
node_version
input.environment variable or via populating a
.nvmrc
file in the workspace.if a
.nvmrc
file exists in the workspace (via a checkout step), thenthe
node_version
input can be omitted.the
volta.node
version will be picked up as well if node_version input or .nvmrc file isn't passed in.NOTE: we still allow passing NODE_VERSION env as a fallback for now. so we could technically publish a v3 and v4 of the step if so desired without modifications. This would allow us to add this step in the default workflow and folks can pass via the nx-cloud cli a
--with-env-vars="NODE_VERSION"
and that node version will be used. (or a .nvmrc/volta.node version).Will hold off on updating the default template until I can confirm how we want to proceed.